package com.collection.synread;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 * Administrator
 *
 * @author jiangbang
 * @date 2016/5/31
 */
public class Demo1 {
    public static void main(String[] args) {
        List<String> list = new ArrayList<String>();
        list.add("a");
        list.add("b");
        //线程安全的list制作完成
        List<String>  synList = Collections.synchronizedList(list);

        //只读
        List<String>  unmoList = Collections.unmodifiableList(list);

        //List<String>  singleList =  Collections.singletonList(list);
    }
}
